package log

import "fmt"

type color int

const (
	Default     color = 00
	Black       color = 30
	Red         color = 31
	Green       color = 32
	Yellow      color = 33
	Blue        color = 34
	PurplishRed color = 35
	Cyan        color = 36
	White       color = 37
)

const (
	colorPrefix = "%c[0;00;%dm%s%c[0m"
	start       = 0x1B
	end         = 0x1B
)

func ColorSprintf(c color, format string, a ...interface{}) string {
	return fmt.Sprintf(colorPrefix, start, c, fmt.Sprintf(format, a...), end)
}
